package com.imoocdl.dataobject;

import com.imoocdl.enums.OrderStatusEnum;
import com.imoocdl.enums.PayStatusEnum;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by pc on 2018/3/30.
 */
@Entity
@Data
@DynamicUpdate  //自动更新updateTime
public class OrderMaster {
    @Id
    private String orderId;
    /**
     * 买家名称
     */
    private String buyerName;
    /**
     * 买家手机号
     */
    private String buyerPhone;
    /**
     * 买家地址
     */
    private String buyerAddress;
    /**
     * 买家微信openID
     */
    private String buyerOpenid;
    /**
     * 订单单价
     */
    private BigDecimal orderAmount;
    /**
     * 订单状态 0=新订单,1=完结,2=取消
     */
    private Integer orderStatus = OrderStatusEnum.NEW.getCode();

    /**
     * 支付状态 0=等待支付 1=支付成功  默认为0
     */
    private Integer payStatus = PayStatusEnum.WAIT.getCode();

    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;

}
